package ninja.awesome.game;

import ninja.awesome.R;
import ninja.awesome.framework.Audio;
import ninja.awesome.framework.Game;
import ninja.awesome.framework.Graphics;
import ninja.awesome.framework.Graphics.ImageFormat;
import ninja.awesome.framework.Image;
import ninja.awesome.framework.Music;
import ninja.awesome.framework.Sound;
import ninja.awesome.framework.impl.AndroidGame;
import android.graphics.Typeface;

public class Assets {
	public static boolean initialized = false;

	public static Image menuBanner;
	public static Image menuBackground;
	public static Music theme;
	public static Sound boom;
	public static Sound slash;
	public static Sound die;
	public static Sound power;
	public static Music menuMusic;
	public static Music fightMusic;

	// IMAGES
	public static Image title = null;
	public static Image myninja = null;
	public static Image attack = null;
	public static Image attackL = null;
	public static Image Life = null;

	public static Image attackR = null;
	public static Image takingdamage = null;
	public static Image background = null;
	public static Image weather1 = null;
	public static Image weather2 = null;
	public static Image weather3 = null;
	public static Image bottom = null;
	public static Image enemyAttack = null;
	public static Image powerup = null;
	public static Image boss = null;

	// ANIMATION ARRAYS
	public static Image at[] = new Image[2];
	public static Image swings[] = new Image[2];
	// public static Image throwingRight[] = new Image[1];

	public static Image eBullet[] = new Image[10];
	public static Image explosion[] = new Image[6];
	public static Image explosion2[] = new Image[7];
	public static Image mp[] = new Image[4];
	public static Image ep[] = new Image[7];
	public static Image ninjaHealthIcon[] = new Image[1];

	public static Image shuriken[] = new Image[1]; // size of
													// the array
	public static Image katanaAttack[] = new Image[1];
	// public static Image ep2[] = new Image[1];
	// public static Image ep3[] = new Image[1];
	public static Image strBullet[] = new Image[2];
	public static Image life[] = new Image[2];
	public static Image building01[] = new Image[2];
	public static Image building02[] = new Image[2];
	public static Image road01[] = new Image[1];
	public static Image bush01[] = new Image[2];
	public static Image bush02[] = new Image[2];
	public static Image bush03[] = new Image[3];
	public static Image tree01[] = new Image[1];
	public static Image tree02[] = new Image[1];
	public static Image tree03[] = new Image[1];
	public static Image tree04[] = new Image[1];

	public static Image btnShot = null;
	public static Image btnJump = null;
	public static Image btnSlash = null;
	public static Image btnUp = null;
	public static Image btnDown = null;
	public static Image btnLeft = null;
	public static Image btnRight = null;

	public static Typeface fontFace;

	public static Image btnJumpPressed;
	public static Image btnShotPressed;
	public static Image btnSlashPressed;
	public static Image btnUpPressed = null;
	public static Image btnDownPressed = null;
	public static Image btnLeftPressed = null;
	public static Image btnRightPressed = null;

	public static Image btnMenuPlay;
	public static Image btnMenuHighScores;
	public static Image btnMenuDonate;

	public static Image btnMenuPlayPressed;
	public static Image btnMenuHighScoresPressed;
	public static Image btnMenuDonatePressed;
	public static String textDonate0;
	public static String textDonate1;
	public static String textDonate2;
	public static String textDonate3;

	public static void playBgMusic(Game sampleGame) {
		// TODO Auto-generated method stub
		theme = sampleGame.getAudio().createMusic("Battle_Line_v1_1_0.mp3");
		theme.setLooping(true);
		theme.setVolume(0.85f);
//		if (AndroidGame.ENABLE_SOUND) {
//			theme.play();
//		}
	}

	public static void initializeResource(AndroidGame game) {
		Graphics g = game.getGraphics();
		Audio audio = game.getAudio();
		Assets.boom = audio.createSound("snd_explosion2.wav");
		Assets.power = audio.createSound("powerup.wav");
		Assets.slash = audio.createSound("slash.wav");
		Assets.die = audio.createSound("lghit.wav");

		Assets.menuBanner = g.newImage("Title.png", ImageFormat.ARGB8888);
		Assets.menuBackground = g.newImage("water.png", ImageFormat.ARGB8888);
		Assets.title = g.newImage("Title.png", ImageFormat.ARGB8888);

		Assets.boss = g.newImage("Boss.png", ImageFormat.ARGB8888);
		Assets.ninjaHealthIcon[0] = g.newImage("ninja1_hp_1.png", ImageFormat.ARGB8888);
		// powerup = g.newImage("powerup, ImageFormat.ARGB8888);
		// myninja = g.newImage("player", ImageFormat.ARGB8888);
		Assets.swings[0] = g.newImage("swingRight.png", ImageFormat.ARGB8888);
		Assets.swings[1] = g.newImage("swingLeft.png", ImageFormat.ARGB8888);

		Assets.shuriken[0] = g.newImage("projectile01.png", ImageFormat.ARGB8888);
		Assets.background = g.newImage("water.png", ImageFormat.ARGB8888);
		// katanaAttack[0] = g.newImage("sword01", ImageFormat.ARGB8888);
		// islands
		// weather1 = g.newImage("island1", ImageFormat.ARGB8888);
		// weather2 = g.newImage("island2", ImageFormat.ARGB8888);
		// weather3 = g.newImage("island3", ImageFormat.ARGB8888);
		Assets.bottom = g.newImage("bottom.png", ImageFormat.ARGB8888);

		// enemyAttack[0] = g.newImage("enemybullet1", ImageFormat.ARGB8888);
		// Enemy Bullet
		Assets.eBullet[0] = g.newImage("enemybullet.png", ImageFormat.ARGB8888);
		Assets.eBullet[1] = g.newImage("bugBullet.png", ImageFormat.ARGB8888);

		// Explosion
		Assets.explosion[0] = g.newImage("explosion1_strip6.png", ImageFormat.ARGB8888);

		Assets.explosion2[0] = g.newImage("explosion2_strip7.png", ImageFormat.ARGB8888);

		// for ninja's animation for player
		// for right standing
		Assets.mp[0] = g.newImage("ninja.png", ImageFormat.ARGB8888);
		// EnemyPlane
		Assets.ep[0] = g.newImage("robotsprite.png", ImageFormat.ARGB8888);
		Assets.ep[1] = g.newImage("robutBug.png", ImageFormat.ARGB8888);

		// life[0] = g.newImage("life", ImageFormat.ARGB8888);

		Assets.building01[0] = g.newImage("building01.png", ImageFormat.ARGB8888);// added
		Assets.building02[0] = g.newImage("building02.png", ImageFormat.ARGB8888); // and
		// //
		// Kim's
		// Implemetation
		Assets.road01[0] = g.newImage("road01.png", ImageFormat.ARGB8888); // I
																			// did
																			// it
		// from Jung
		// Hwan Kim

		Assets.bush01[0] = g.newImage("bushes_long.png", ImageFormat.ARGB8888);
		Assets.bush02[0] = g.newImage("bushes_middle.png", ImageFormat.ARGB8888);
		Assets.bush03[0] = g.newImage("bushes_short.png", ImageFormat.ARGB8888);
		Assets.tree01[0] = g.newImage("green_tree1.png", ImageFormat.ARGB8888);
		Assets.tree02[0] = g.newImage("green_tree2.png", ImageFormat.ARGB8888);
		Assets.tree03[0] = g.newImage("sakura_tree.png", ImageFormat.ARGB8888);
		Assets.tree04[0] = g.newImage("cut_tree.png", ImageFormat.ARGB8888);

		Assets.btnJump = g.newImage("btn_jump.png", ImageFormat.ARGB8888);
		Assets.btnShot = g.newImage("btn_shot.png", ImageFormat.ARGB8888);
		Assets.btnSlash = g.newImage("btn_slash.png", ImageFormat.ARGB8888);
		Assets.btnJumpPressed = g.newImage("btn_jump_pressed.png", ImageFormat.ARGB8888);
		Assets.btnShotPressed = g.newImage("btn_shot_pressed.png", ImageFormat.ARGB8888);
		Assets.btnSlashPressed = g.newImage("btn_slash_pressed.png", ImageFormat.ARGB8888);

		Assets.btnMenuPlay = g.newImage("btn_play.png", ImageFormat.ARGB8888);
		Assets.btnMenuHighScores = g.newImage("btn_high_scores.png", ImageFormat.ARGB8888);
		Assets.btnMenuDonate = g.newImage("btn_donate.png", ImageFormat.ARGB8888);

		Assets.btnMenuPlayPressed = g.newImage("btn_play_pressed.png", ImageFormat.ARGB8888);
		Assets.btnMenuHighScoresPressed = g.newImage("btn_high_scores_pressed.png", ImageFormat.ARGB8888);
		Assets.btnMenuDonatePressed = g.newImage("btn_donate_pressed.png", ImageFormat.ARGB8888);

		Assets.btnUp = g.newImage("btn_up.png", ImageFormat.ARGB8888);
		Assets.btnDown = g.newImage("btn_down.png", ImageFormat.ARGB8888);
		Assets.btnLeft = g.newImage("btn_left.png", ImageFormat.ARGB8888);
		Assets.btnRight = g.newImage("btn_right.png", ImageFormat.ARGB8888);

		Assets.btnUpPressed = g.newImage("btn_up_pressed.png", ImageFormat.ARGB8888);
		Assets.btnDownPressed = g.newImage("btn_down_pressed.png", ImageFormat.ARGB8888);
		Assets.btnLeftPressed = g.newImage("btn_left_pressed.png", ImageFormat.ARGB8888);
		Assets.btnRightPressed = g.newImage("btn_right_pressed.png", ImageFormat.ARGB8888);
		Assets.textDonate0 = game.getResources().getString(R.string.donate_text_0);
		Assets.textDonate1 = game.getResources().getString(R.string.donate_text_1);
		Assets.textDonate2 = game.getResources().getString(R.string.donate_text_2);
		Assets.textDonate3 = game.getResources().getString(R.string.donate_text_3);

		initialized = true;
	}
}
